﻿using UFSoft.UBF.Business;
using UFSoft.UBF.Eventing;

namespace UFIDA.U9.CusDev.AITPlugInBE
{
    /// <summary>
    /// 记录实体日志 BE插件
    /// </summary>
    class ProcessForAIT : IEventSubscriber
    {
        public void Notify(params object[] args)
        {
            if (args == null || args.Length == 0 || !(args[0] is EntityEvent)) return;
            BusinessEntity.EntityKey key = ((EntityEvent)args[0]).EntityKey;

            if (key == null || key.GetEntity() == null) return;
            BusinessEntity entity = key.GetEntity();
            if (entity == null) return;

            //实体属性日志,修改时,LOG中记录属性编码
            LogUtils.EntityLog(entity);
            //实体json日志,新增是,直接创建JSON文件
            LogUtils.JsonLog(entity);
            
        }
    }
}
